package com.info.zhiduoduo.common.constants.city;

import com.info.zhiduoduo.common.constants.EnumFindHelper;

/**
 * 开户城市, 创客,智众包企业等等开户地,影响项目限额,税率等等
 * <p> 与表{@code zdd_city_config}的主键id对应
 */
public enum TaxCityEnum {

	UNKOWN(0, ""),
	TIANJIN(1, "天津市"),
	GONGQINGCHENG(2, "共青城"),
	WUHU(3, "芜湖市"),
	PUTUOSHAN(4, "普陀山"),
	XUZHOU(5, "徐州市"),
	YINCHUAN(6, "银川市"),
	CHANGSHA(7, "长沙市"),
	;

	public int id;
	public String name;

	TaxCityEnum(int id, String name) {
		this.id = id;
		this.name = name;
	}

	//####################################### 方便查找枚举值的方法 ###################################//

	static final EnumFindHelper<TaxCityEnum, Integer> IdHelper = new EnumFindHelper<>(TaxCityEnum.class, e -> e.id);

	static final EnumFindHelper<TaxCityEnum, String> NameHelper = new EnumFindHelper<>(TaxCityEnum.class, e -> e.name);

	public static TaxCityEnum findById(int id) {
		return IdHelper.find(id, UNKOWN);
	}

	public static TaxCityEnum findByName(String name) {
		return NameHelper.find(name, UNKOWN);
	}
}
